
//此处使用ES6，属性名表达式，只有在读取对象的属性时才能使用。
const windowInfo = {
  namespaced: true,
  state: {
    tabName:"first",
    infoBoxContent:'',
    chartVisiable:false,
    infoBoxMainVisiable:false,
    infoContent:{
      one:"伊春鹿鸣矿业有限公司",
      two:"尾矿库",
      three:"风险等级:二级"
    },
    todos: [
      { id: 1, text: '...', done: true },
      { id: 2, text: '...', done: false }
    ]
  },
  mutations: {
    insert (state,count) {
      // 变更状态
      state.count = count
    },
    changeTabName(state,tabName){
      state.tabName = tabName
    },
    changeInfoBoxContent(state,infoBoxContent){
      state.infoBoxContent = infoBoxContent
    },
    changeInfoBoxMainVisiable(state,infoBoxMainVisiable){
      state.infoBoxMainVisiable = infoBoxMainVisiable
    },
    changeChartVisiable(state,chartVisiable){
      state.chartVisiable = chartVisiable
    },
    changeInfoContent(state,infoContent){
      state.infoContent = infoContent
    }
  },//commit与action 除了一步之外，其他情况都一样
  actions: {
    increment ({commit},count) {
      
        commit('insert',count)
      
    }
  },
  getters: {
    doneTodos: state => {
      return state.todos.filter(todo => todo.done)
    }
  }
}

export default windowInfo